<?php
//包含连接数据库的公共文件
require_once("./conn.php");


    //获取表单提交数据
    $son=$_POST["son"];
    $sname=$_POST["sname"];
    $sbirth=$_POST["sbirth"];
    $ssex=$_POST["ssex"];
    $sclass=$_POST["sclass"];
    $zon=$_POST["zon"];

    //构建插入SQL语句
    $sql="insert into insert_student values('$son','$sname','$sbirth','$ssex','$sclass','$zon')";
    echo $sql;
    $set=mysqli_query($con,$sql);
    if($set==1){
        echo "<script>alert('添加成功');location='add.html';</script>";
    }else{
        echo "<script>alert('添加失败');location='add.html';</script>";
    }


?>